

 PLUS:
  PUSH(FP);
  MOV(FP,SP);

  PUSH(R1); //save R1
  PUSH(R2); //save R2
  MOV(R1, FPARG(1)); //R1= n
  MOV(R0, IMM(0)); //intialize R0=0

 L_PLUS_LOOP:
  MOV(R2,FPARG(R1+1)); //move argument n to R2

  CMP(IND(R2),IMM(T_INTEGER)); //check argument type
  JUMP_NE(TYPE_ERROR); 

  ADD(R0,INDD(R2,1)); //add argument to R0
  ADD(R1,-1); //decrement n 
  CMP(R1, IMM(0)); //check if n is 0

  JUMP_NE(L_PLUS_LOOP);
  PUSH(R0);

  CALL(MAKE_SOB_INTEGER);
  DROP(1);

  POP(R2);
  POP(R1);
  POP(FP);
  RETURN;
